package com.zy.chat.controller;


import com.zy.chat.service.FriendService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping(value = "friendcontroller")
public class FriendController {

    @Autowired
    FriendService friendService;

    @GetMapping(value = "iffriend/{userId}/{friendId}")
    public ResponseEntity<Boolean> ifFriend(@PathVariable(value = "userId")int userId,@PathVariable(value = "friendId")int friendId){
        return new ResponseEntity<Boolean>(this.friendService.ifFriend(userId, friendId), HttpStatus.OK);
    }
}
